package com.project.finance.mobile.user.service.impl;

import com.project.finance.common.mapper.TbUsersMapper;
import com.project.finance.common.po.TbUsers;
import com.project.finance.mobile.user.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

/**
 * @Author: Brendan Li
 * @description 登录实现
 * @Date: 2019/12/09/19:20
 */
@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private TbUsersMapper tbUsersMapper;

    @Override
    public TbUsers getUser(String phoneNum) {

        Example example = new Example(TbUsers.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("phoneNumber",phoneNum);
        TbUsers tbUsers = tbUsersMapper.selectOneByExample(example);

        return tbUsers;
    }
}
